package com.sx.export.controller;

import com.sx.export.service.ExportExcelService;
import com.sx.frame.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Slf4j
public class ExportExcelController {

    @Autowired
    private ExportExcelService exportExcelService;

    /**
     * 单线程导出
     * @return
     */
    @GetMapping("singleThread")
    public Result<?> exportExcelSignleThead() {
        return Result.OK(exportExcelService.exportExcelSignleThead());
    }

    /**
     * 多线程导出
     * @return
     */
    @GetMapping("multThead")
    public Result<?> exportExcelMultThead() {
        return Result.OK(exportExcelService.exportExcelMultThead());
    }

    /**
     * 多线程导出
     * @return
     */
    @GetMapping("/importSql")
    public Result<?> importSql() {
        return Result.OK(exportExcelService.importSql());
    }

    /**
     * 多线程导出
     * @return
     */
    @GetMapping("/synTest")
    public Result<?> synTest() {
        return Result.OK(exportExcelService.synTest());
    }

}
